<!DOCTYPE html>
<html>
<head>
    <title>附件表</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.fileName" @on-enter="query" placeholder="附件名称"></i-input>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("annexfile:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("annexfile:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("annexfile:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="annexFile" :rules="ruleValidate" :label-width="80">
            <!--<Form-item label="删除标识" prop="delFlag">
                <i-input v-model="annexFile.delFlag" placeholder="删除标识"></i-input>
            </Form-item>
            <Form-item label="上传日期" prop="uploadDate">
                <i-input v-model="annexFile.uploadDate" placeholder="上传日期"></i-input>
            </Form-item>-->
            <Form-item label="附件名称" prop="fileName">
                <i-input v-model="annexFile.fileName" placeholder="附件名称"></i-input>
            </Form-item>
            <Row>
                <i-col span="16">
                    <Form-item label="附件" prop="url">
                        <i-hidden v-model="annexFile.url" placeholder="请上传" readonly></i-hidden>
                        <i-input v-model="picUrl" readonly></i-input>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload ref="uploadFile" style="width: 300px;" action="../sys/oss/user/file"
                                :before-upload="handleBeforeUpload"
                                :on-success="handleSuccess" :on-format-error="handleFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <i-button icon="md-arrow-dropdown-circle"  @click="eyeFile(annexFile.url)">预览</i-button>
                    </Form-item>
                </i-col>
            </Row>
            <!--<Form-item label="附件" prop="url">
                <i-input v-model="annexFile.url" placeholder="附件"></i-input>
            </Form-item>-->
            <Form-item label="模块类型" prop="type">
                <i-select v-model="annexFile.type" placeholder="模块类型">
                    <i-option v-for="item in moduleTypeList" :value="item.value" :key="item.value">{{item.name}}
                    </i-option>
                </i-select>
                <!--<i-input v-model="annexFile.type" placeholder="所属类型"></i-input>-->
            </Form-item>
            <Form-item label="文件类型" prop="fileType">
                <i-select v-model="annexFile.fileType" placeholder="文件类型">
                    <i-option v-for="item in knowTypeList" :value="item.value" :key="item.value">{{item.name}}
                    </i-option>
                </i-select>
                <!--<i-input v-model="annexFile.fileType" placeholder="文件类型"></i-input>-->
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/sys/annexfile.js?_${date.systemTime}"></script>
</body>
</html>
